import axios from "./api.request";
import config from "@/config";
const host = config.BASE_HOST;
const hosts = url => {
  return host + url;
};

const info = hosts("wheel/info");
const history = hosts("wheel/history");
const rotate = hosts("wheel/rotate");

export const getInfo = () => {
  return axios.request({
    url: info,
    method: "get",
  });
};

// type 0 全部， 1 自己
export const getHistory = (type = 0) => {
  return axios.request({
    url: history,
    method: "get",
    params: { type },
  });
};

export const getRotate = () => {
  return axios.request({
    url: rotate,
    method: "post",
  });
};
